
<template>
  <div style="margin-top: 15px; padding: 0 16px">
    <el-tabs type="border-card" style="min-height: 320px; box-shadow: none">
      <el-tab-pane>
        <template #label>
          <span><i class="el-icon-date"></i>问题</span>
        </template>
        <vol-table ref="tableList"
                 :loadKey="true"
                 :columns="columns"
                 :pagination-hide="true"
                 :height="210"
                 :defaultLoadPage="false"
                 @loadBefore="loadBefore"
                 url="/api/PROJ_AssemblyIssue/GetPageData"
                 :row-index="true"
                 :index="false"></vol-table>
           
      </el-tab-pane>
      <!-- <el-tab-pane :lazy="true" label="工位">工位</el-tab-pane> -->

    </el-tabs>
  </div>
</template>
<script>
import VolTable from "@/components/basic/VolTable.vue";
export default {
  components: {
    VolTable
  },
  methods: {
    loadBefore (params, callback) {
      var _row;
      //获取主表选中的行
      this.$emit("parentCall", ($vue) => {
        var rows = $vue.getSelectRows();
        if (rows.length) {
          _row = rows[0];
        }
      });
      if (!_row) {
        //取消选中，清空明细
        return (this.$refs.tableList.rowData.length = 0);
        //  return this.$Message.error("请选中主表行数据");
      }
      params.wheres =[{ name: "BOM_Id", value: _row.BOM_Id},{ name: "PROJAssembly_Id", value: _row.PROJAssembly_Id}];
      return callback(true);
    }
  },
  data () {
    return {
      tableData: [],
      //从生成的代码sellorder2.vue里面把明细配置复制过来就能用
      columns:  [{field:'PROJAssemblyStep_Id',title:'PROJAssemblyStep_Id',type:'guid',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'PROJAssembly_Id',title:'PROJAssembly_Id',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'Solution',title:'解决方案',type:'string',width:110,align:'left',sort:true},
                       {field:'Description',title:'描述',type:'string',width:220,align:'left'},
                       {field:'Status',title:'状态',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateBy',title:'创建人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'CreateOn',title:'创建时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'UpdateBy',title:'更新人',type:'string',width:110,hidden:true,align:'left'},
                       {field:'LastUpdateOn',title:'更新时间',type:'datetime',width:150,hidden:true,align:'left',sort:true},
                       {field:'IsDeleted',title:'逻辑删除 0/不删除 1/已删除',type:'bool',width:110,hidden:true,align:'left'}],
     
    }
  }
}
</script>
<style scoped>
 h3{
     font-weight: 500;
    padding-left: 10px;
    background: white;
    margin-top: 8px;
    padding-bottom: 5px;
 }
</style>